<template>
    <div class="dingdan">
        <div class="top">
            <div v-for="(item,index) in bannerlist" :key="index">{{item}}</div>
        </div>
        <div class="mainlist" v-if="orderlist.length">
            <div class="list" v-for="(item,index) in orderlist" :key="index" >
                <div class="left">
                    <img :src="item.picUrl" alt="" class="img2">
                </div>
                <div class="right">
                    <div class="first">{{item.name}}</div>
                    <div class="third">￥{{item.wmPoiScore}}</div>
                </div>
                <div class="box">
                    <span class="time">再来一单</span>
                </div>
            </div>
        </div>
        <!-- 骨架屏 -->
        <van-skeleton v-else title :row="25" />
    </div>
</template>

<script setup>

import { onMounted,ref } from 'vue';
import { user_shouye } from '../../api'

var bannerlist = ref(['全部','待消费','待评价','退款'])
var orderlist = ref([])

onMounted(()=>{
    user_shouye().then((res)=>{
            orderlist.value = res.data.list
            // console.log(orderlist.value );
        })
})

</script>

<style scoped>
    .top{
        width: 100%;
        height: 80px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        background-color: #00bfff;
        border-radius: 10px;
        color: white;
        font-size: 20px;
    }
    .mainlist{
        width: 100%;
        height: 580px;
        background-color: #00bfff;
        border-radius: 10px;
        margin-top: 10px;
        overflow: auto;
        box-sizing: border-box;
        padding: 10px;
    }
    
    .list{
        display: flex;
        box-sizing: border-box;
        padding: 5px;
        position: relative;
        margin-bottom: 10px;
        background-color: white;
        border-radius: 10px;
    }
    .left{
        width: 30%;
    }
    .img2{
        width: 100%;
        height: 100px;
        border-radius: 10px;
    }
    .right{
        margin-top: 5px;
        margin-left: 20px;
    }
    .first{
        font-size: 20px;
        margin-bottom: 5px;
    }
    .third{
        color: red;
        font-size: 18px;
        margin-bottom: 5px;
        margin-top: 15px;
    }
    .box{
        position: absolute;
        right:15px;
        top:60px;
        width: 80px;
        height: 30px;
        border: 2px solid rgb(0, 200, 255);
        line-height: 30px;
        text-align: center;
    }
    .time{
        margin-left: 5px;
        color: rgb(0, 200, 255);
    }

</style>